package com.zxl.app.controller.common;

import com.zxl.common.Result;
import com.zxl.common.utils.OssUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;

/**
 * @author zxw
 * @date 2023/4/4
 */
@RestController
@RequestMapping("/app/common")
@Slf4j
@Api(tags = {"通用模块"})
public class CommonController {
    @Resource
    private OssUtils ossUtils;

    @ApiOperation("图片上传")
    @PostMapping("/upload")
    public Result memberUpdate(MultipartFile file){
        String url = ossUtils.upload(file);
        return new Result<String>(url);
    }


}
